package com.rcl.himalaya_kotlin.utils

import android.content.Context

/*
 * class title: 
 * Author by RenChunLin, Email 18957806320@163.com, Date on 2020/9/3.
 * PS: Not easy to write code, please indicate.
 */
object UIUtil {
    fun dip2px(context: Context, dpValue: Double): Int {
        val density = context.resources.displayMetrics.density
        return (dpValue * density + 0.5).toInt()
    }

    fun getScreenWidth(context: Context): Int {
        return context.resources.displayMetrics.widthPixels
    }
}